<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <img
      src="https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png"
      alt="logo"
    />
    <img
      src="https://wwc.alicdn.com/avatar/getAvatar.do?userNick=&width=60&height=60&type=sns&_input_charset=UTF-8"
      alt="淘宝"
    />
  </body>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
  <script>
    //a.获取属性值
    //attr(属性名)
    console.log($("img").eq(0).attr("src"));
    //b.设置属性
    //attr(属性名，属性值)
    $("img")
      .eq(0)
      .attr("src", "https://fanyi.youdao.com/img/logo.50fdfa99.png");
    //c.删除属性
    //removeAttr(属性名)
    $("img:eq(0)").removeAttr("src");
  </script>
</html>
